package com.jadows.tdog.server.codec;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONWriter;
import com.jadows.tdog.message.WSRespWrapper;
import com.jadows.tdog.message.WsReqWrapper;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;

/**
 * @author taojiacheng
 */
public class JsonWebSocketFrame extends TextWebSocketFrame {

    public JsonWebSocketFrame(WsReqWrapper<?> msg) {
        super(JSON.toJSONString(msg, JSONWriter.Feature.WriteLongAsString));
    }

    public JsonWebSocketFrame(WSRespWrapper msg) {
        super(JSON.toJSONString(msg, JSONWriter.Feature.WriteLongAsString));
    }
}
